﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Admin_Product.aspx.cs"
    Inherits="V5_EShop.Admin.GZProduct.Admin_Product" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <%=V5.Load.LoadAdminHeader(this) %>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="100%" border="0" cellpadding="2" cellspacing="1" class="tablelist">
            <tr>
                <td class="headertext">
                    <div align="left">
                        位置导航：<a class="list_link" href="../../Admin_Index_Main.aspx" target="main">首页</a>
                        >> 商品管理</div>
                </td>
            </tr>
            <tr>
                <td>
                    <a href="?">管理首页</a> | <a href="?Action=edit">添加商品</a>
                </td>
            </tr>
        </table>
        <asp:MultiView ID="MultiViewList" runat="server" ActiveViewIndex="0">
            <asp:View ID="View1" runat="server">
                <table border="0" cellpadding="0" cellspacing="0" class="tablelist">
                    <tr>
                        <td>
                            操作选项:<asp:DropDownList ID="ddlSearchType" runat="server">
                                <asp:ListItem Text="请选择" Value="0"></asp:ListItem>
                                <asp:ListItem Text="选择删除" Value="del"></asp:ListItem>
                            </asp:DropDownList>
                            <asp:Button ID="btnSearchType" runat="server" Text="确定操作" OnClick="btnSearchType_Click"/>
                            搜索:<asp:TextBox ID="txtSearchTitle" runat="server"></asp:TextBox><asp:Button ID="btnSearchTitle"
                                runat="server" Text="搜索" OnClick="txtSearchTitle_Click" />
                        </td>
                    </tr>
                </table>
                <asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" GridLines="None"
                    OnRowCommand="gvList_RowCommand" CssClass="tablelist overlist">
                    <HeaderStyle CssClass="headertext" />
                    <Columns>
                        <asp:TemplateField HeaderText="编号" HeaderStyle-Width="30px">
                            <HeaderTemplate>
                                <input id="Checkbox1" type="checkbox" onclick="SelectAll(this)" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="chkitem" runat="server" />
                                <asp:HiddenField ID="hfID" runat="server" Value='<%#Eval("ID") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="分类" HeaderStyle-Width="100px">
                            <ItemTemplate>
                                <span style='color: Blue'>[<%# GetModel_Class(Eval("ProductTypeID")).TypeName %>]</span>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="ProductName" HeaderText="商品名称"></asp:BoundField>
                        <asp:TemplateField HeaderText="操作">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" CommandArgument='<%#Bind("ID")%>' CommandName="go"
                                    runat="server">修改</asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="LinkButton2" CommandArgument='<%#Bind("ID")%>' CommandName="del"
                                    runat="server" OnClientClick="return confirm('你确定要删除吗?');">删除</asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="200px" />
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <table border="0" cellpadding="0" cellspacing="0" class="tablelist">
                    <tr>
                        <td>
                            <webdiyer:AspNetPager ID="Pager" runat="server" CustomInfoHTML="共%PageCount%页，当前为第%CurrentPageIndex%页，每页%PageSize%条"
                                FirstPageText="首页" HorizontalAlign="Right" LastPageText="尾页" NextPageText="下一页"
                                OnPageChanged="Pager_PageChanged" PageIndexBoxType="DropDownList" PageSize="20"
                                PrevPageText="上一页" ShowCustomInfoSection="Left" ShowPageIndexBox="Always" SubmitButtonText="Go"
                                TextAfterPageIndexBox="页" TextBeforePageIndexBox="转到" AlwaysShow="True" Width="100%">
                            </webdiyer:AspNetPager>
                        </td>
                    </tr>
                </table>
            </asp:View>
            <asp:View ID="View2" runat="server">
                <table width="100%" border="0" cellpadding="2" cellspacing="1" class="tablelist">
                    <tr class="headertext">
                        <td colspan="8">
                            <asp:Label ID="lblTitle" runat="server" Text="添加商品"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 15%;">
                            商品类别:
                        </td>
                        <td style="width: 16%;">
                            <asp:DropDownList ID="ddlProductTypeID" runat="server">
                            </asp:DropDownList>
                        </td>
                        <td style="width: 10%;">
                            市场零售指导价:
                        </td>
                        <td style="width: 16%;">
                            <asp:TextBox ID="txtMaxSalePrice" runat="server">0</asp:TextBox>
                        </td>
                        <td style="width: 10%;">
                            最高进货零售价:
                        </td>
                        <td style="width: 16%;">
                            <asp:TextBox ID="txtMaxInPrice" runat="server">0</asp:TextBox>
                        </td>
                        <td style="width: 10%;">
                            &nbsp;
                        </td>
                        <td style="width: 16%;">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            商品编码:
                        </td>
                        <td>
                            <asp:TextBox ID="txtSerialNo" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            统一批发价:
                        </td>
                        <td>
                            <asp:TextBox ID="txtSalePrice4" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            最高进货件价:
                        </td>
                        <td>
                            <asp:TextBox ID="txtMaxInPiecePrice" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            条形码:
                        </td>
                        <td>
                            <asp:TextBox ID="txtBarCode" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            一级代理价格:
                        </td>
                        <td>
                            <asp:TextBox ID="txtSalePrice1" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            最低进货零单价:
                        </td>
                        <td>
                            <asp:TextBox ID="txtMinInPrice" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            件条码:
                        </td>
                        <td>
                            <asp:TextBox ID="txtPackageBarCode" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            二级代理价格:
                        </td>
                        <td>
                            <asp:TextBox ID="txtSalePrice2" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            最低进货件价:
                        </td>
                        <td>
                            <asp:TextBox ID="txtMinInPiecePrice" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            商品名称:<span class="font-red">*</span>
                        </td>
                        <td>
                            <asp:TextBox ID="txtProductName" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            三级代理价格:
                        </td>
                        <td>
                            <asp:TextBox ID="txtSalePrice3" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            进货零单价:
                        </td>
                        <td>
                            <asp:TextBox ID="txtStockInPrice" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            拼音码:
                        </td>
                        <td>
                            <asp:TextBox ID="txtProductShortCutName" runat="server"></asp:TextBox>
                        </td>
                        <td style="width: 10%;">
                            子公司批发价:
                        </td>
                        <td style="width: 16%;">
                            <asp:TextBox ID="txtAverageInPrice" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            进货件单价:
                        </td>
                        <td>
                            <asp:TextBox ID="txtStockInPiecePrice" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            简称:
                        </td>
                        <td>
                            <asp:TextBox ID="txtProductShortName" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            会员价:
                        </td>
                        <td>
                            <asp:TextBox ID="txtMemberPrice" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            最高库存:
                        </td>
                        <td>
                            <asp:TextBox ID="txtMaxStockNum" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            单位:
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlUnitID" runat="server">
                            </asp:DropDownList>
                        </td>
                        <td>
                            件销售价1:
                        </td>
                        <td>
                            <asp:TextBox ID="txtSalePiecePrice1" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            最低库存:
                        </td>
                        <td>
                            <asp:TextBox ID="txtMinStockNum" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            包装:
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlPackageUnitID" runat="server">
                            </asp:DropDownList>
                        </td>
                        <td>
                            件销售价2:
                        </td>
                        <td>
                            <asp:TextBox ID="txtSalePiecePrice2" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            最低件单价:
                        </td>
                        <td>
                            <asp:TextBox ID="txtMinSalePiecePrice" runat="server" Text="0.00"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span style="font-family: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;; mso-bidi-font-family: &quot;Times New Roman&quot;; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
                            包装数量</span>:
                        </td>
                        <td>
                            <asp:TextBox ID="txtPackageSpec" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            件销售价3:
                        </td>
                        <td>
                            <asp:TextBox ID="txtSalePIecePrice3" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            总数量:
                        </td>
                        <td>
                            <asp:TextBox ID="txtTotalNum" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            生产厂家名称:
                        </td>
                        <td>
                            <asp:TextBox ID="txtManufactureName" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            件销售价4:
                        </td>
                        <td>
                            <asp:TextBox ID="txtSalePiecePrice4" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            总金额:
                        </td>
                        <td>
                            <asp:TextBox ID="txtTotalMoney" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            是否积分（活动）:
                        </td>
                        <td>
                            <asp:CheckBox ID="chkIntegralSign" runat="server" />
                        </td>
                        <td>
                            会员折扣:
                        </td>
                        <td>
                            <asp:TextBox ID="txtMemberDiscont" runat="server">0</asp:TextBox>
                        </td>
                        <td>
                            有效日期:
                        </td>
                        <td>
                            <asp:TextBox ID="txtKeepQulityDate" runat="server" CssClass="Wdate" onFocus="showDateTime();"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            积分比例:
                        </td>
                        <td>
                            <asp:TextBox ID="txtIntegralRate" runat="server">0</asp:TextBox>
                        </td>
                        <td>
                            最低销售价:
                        </td>
                        <td>
                            <asp:TextBox ID="txtMinSalePrice" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            规格型号:
                        </td>
                        <td>
                            <asp:TextBox ID="txtSpecMode" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            是否允许负库存:
                        </td>
                        <td>
                            <asp:CheckBox ID="chkNoStockCanSales" runat="server" />
                        </td>
                        <td>
                            最高件单价:
                        </td>
                        <td>
                            <asp:TextBox ID="txtMaxSalePiecePrice" runat="server" Text="0.00"></asp:TextBox>
                        </td>
                        <td>
                            备注:
                        </td>
                        <td>
                            <asp:TextBox ID="txtRemark" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            有效期(天):
                        </td>
                        <td>
                            <asp:TextBox ID="txtUserfulLife" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            业务员提成比率:
                        </td>
                        <td>
                            <asp:TextBox ID="txtSellerRate" runat="server">0</asp:TextBox>
                        </td>
                        <td>
                            备注1:
                        </td>
                        <td>
                            <asp:TextBox ID="txtRemark1" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            是否停用:
                        </td>
                        <td>
                            <asp:CheckBox ID="chkDisable" runat="server" />
                        </td>
                        <td>
                            操作员提成比率:
                        </td>
                        <td>
                            <asp:TextBox ID="txtUserRate" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            备注2:
                        </td>
                        <td>
                            <asp:TextBox ID="txtRemark2" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            是否导出电子称:
                        </td>
                        <td>
                            <asp:CheckBox ID="chkIsEcalled" runat="server" />
                        </td>
                        <td>
                            会员提成比率:
                        </td>
                        <td>
                            <asp:TextBox ID="txtRecommendedRate" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            备注3:
                        </td>
                        <td>
                            <asp:TextBox ID="txtRemark3" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            促销价:
                        </td>
                        <td>
                            <asp:TextBox ID="txtPromotionsPrice" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            赠品条形码:
                        </td>
                        <td>
                            <asp:TextBox ID="txtGiftsBarCode" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            备注4:
                        </td>
                        <td>
                            <asp:TextBox ID="txtRemark4" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            促销开始日期:
                        </td>
                        <td>
                            <asp:TextBox ID="txtPromotionsSDate" runat="server" CssClass="Wdate" onFocus="showDateTime();"></asp:TextBox>
                        </td>
                        <td>
                            赠品积分:
                        </td>
                        <td>
                            <asp:TextBox ID="txtGiftsIntegral" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td>
                            备注5:
                        </td>
                        <td>
                            <asp:TextBox ID="txtRemark5" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            促销结束日期:
                        </td>
                        <td>
                            <asp:TextBox ID="txtPromotionsEDate" runat="server" CssClass="Wdate" onFocus="showDateTime();"></asp:TextBox>
                        </td>
                        <td>
                            是否赠品:
                        </td>
                        <td>
                            <asp:CheckBox ID="chkIsGifts" runat="server" />
                        </td>
                        <td>
                            备注6:
                        </td>
                        <td>
                            <asp:TextBox ID="txtRemark6" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            最后进货日期:
                        </td>
                        <td>
                            <asp:TextBox ID="txtLastInDate" runat="server" CssClass="Wdate" onFocus="showDateTime();"></asp:TextBox>
                        </td>
                        <td>
                            品牌ID:
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlBrandID" runat="server">
                            </asp:DropDownList>
                        </td>
                        <td>
                            图片:
                        </td>
                        <td>
                            <asp:FileUpload ID="fuProductFilePath" runat="server" />
                            <%--<asp:TextBox ID="txtImage" runat="server"></asp:TextBox>--%>
                        </td>
                        <td>
                            <asp:HiddenField ID="hfProductFilePath" runat="server" />
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            最后进货价:
                        </td>
                        <td>
                            <asp:TextBox ID="txtLastInPrice" runat="server">0</asp:TextBox>
                        </td>
                        <td>
                            使用天数:
                        </td>
                        <td>
                            <asp:TextBox ID="txtUseDay" runat="server" Text="0"></asp:TextBox>
                        </td>
                        <td> 
                            特供品: </td>
                        <td>
                            &nbsp;
                            <asp:CheckBox ID="chkSpecialofferings" runat="server" />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            是否直销(热卖)：
                        </td>
                        <td>
                            <asp:CheckBox ID="chkDirectMarketing" runat="server" />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp; 是否主页FLASH广告:</td>
                        <td>
                            &nbsp;
                            <asp:CheckBox ID="chkIsShow" runat="server" />
                            </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                     <tr>
                        <td>
                            排序：
                        </td>
                        <td>
                            <asp:TextBox ID="txtOid" runat="server">0</asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;  </td>
                        <td>
                            &nbsp;
                            
                            </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            商品详细
                        </td>
                        <td colspan="6">
                            <asp:TextBox ID="txtProductDetails" runat="server" TextMode="MultiLine"></asp:TextBox>
                            <script type="text/javascript">


        			        //<![CDATA[
                                CKEDITOR.replace('<%= this.txtProductDetails.ClientID %>',
					        {
					            skin: 'v2',
					            height: 350,
					            resize_enabled: false
					        });
        			        //]]>
                            </script>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" align="center">
                            &nbsp;
                        </td>
                        <td align="center">
                            <asp:HiddenField ID="hfID" runat="server" Value="0" />
                        </td>
                        <td align="center">
                            <asp:Button ID="btnSave" runat="server" OnClientClick="return ChkAmount()" OnClick="btnSave_Click" Text="保存添加" CssClass="ds-btn ds-btn-ok" />
                        </td>
                        <td align="center">
                            &nbsp;
                        </td>
                        <td align="center">
                            &nbsp;
                        </td>
                        <td align="center">
                            &nbsp;
                        </td>
                        <td align="center">
                            &nbsp;
                        </td>
                    </tr>
                </table>
                <script>
                    var ChkAmount = function () {
                        var t = $("#txtBarCode").val();
                        var am = parseInt($("#txtPackageSpec").val());
                        if (t != "") {
                            if (am <= 0) {
                                alert("包装数量不能为0");
                                $("#txtPackageSpec").focus();
                                return false;
                            }
                        }


                        var ts = $("#ddlProductTypeID").val();

                        if (ts <= 0) {
                            alert("请先选择分类");
                            $("#ddlProductTypeID").focus();
                            return false;
                        }

                        var code = $("#txtSerialNo").val();

                        if ($.trim(code)=="") {
                            alert("请输入商品编号");
                            $("#txtSerialNo").focus();
                            return false;
                         }


                        return true;
                    }
                </script>
                <!--
                <asp:TextBox ID="txtProducingArea" runat="server" Text="0"></asp:TextBox>
                <asp:DropDownList ID="ddlProviderID" runat="server">
                </asp:DropDownList>
                -->
                <script type="text/javascript">
                $(function() {
                    $("#<%=this.Form.ClientID %>").validate({
                        rules: {
                        <%=txtProductName.UniqueID %>: 
                        {
                            required: true
                        }
                    },
                    messages:{
                        <%=txtProductName.UniqueID %>: 
                        {
                            required: "标题不能为空!"
                        }
                    }
                });
            });
                </script>
            </asp:View>
        </asp:MultiView>
    </div>
    </form>
</body>
</html>
